import {
  SUPPLIER_CATEGORY_SELECT_LIST,
  STOREHOUSE_NATURE_SELECT_LIST,
  PLANT_NATURE_SELECT_LIST,
  PRICE_BASE_ON_RAW_MATERIAL_SELECT_LIST,
  YN_SELECT_LIST,
  COMMERCIAL_ACCEPTANCE_LIST,
} from '@/pages/supplier/constants/common';
// 考察报告录入信息
// 基本信息 拜访时间
const BASE_INFO_FIELDS = [
  { prop: 'visitTime', label: '拜访开始时间', type: 'dateTime', required: false },
  { prop: 'inspectCompleteTime', label: '拜访结束时间', type: 'dateTime', required: false },
  { prop: 'negotiationDetail', label: '考察谈判详情', type: 'inputText', required: false },
  { prop: 'disposalMeasures', label: '处理措施', type: 'inputText', required: false },
  { prop: 'subsequentBacklogName', label: '后续待办', type: 'input', required: false },
  { prop: 'backlogExplain', label: '待办说明', type: 'inputText', maxlength: 200, required: false },
  { prop: 'planCompleteTime', label: '预计完成时间', type: 'dateTime', required: false },
]
// 基本信息 基础信息
const BASIC_INFO_FIELDS = [
  { prop: 'staffSize', label: '人员规模', type: 'inputNum', maxlength: 15, required: false, target: 1 },
  { prop: 'storehouseNature', label: '库房性质', type: 'select', options: STOREHOUSE_NATURE_SELECT_LIST, required: false, target: 1 },
  { prop: 'storehouseAddress', label: '库房地址', type: 'input', required: false, target: 1 },
  { prop: 'plantNature', label: '厂房性质', type: 'select', options: PLANT_NATURE_SELECT_LIST, required: false, target: 1 },
  { prop: 'plantAddress', label: '厂房地址', type: 'input', required: false, target: 1 },
]
// 基本信息 基础信息
const BASIC_INFO_VIEW_FIELDS = [
  { prop: 'staffSize', label: '人员规模', type: 'inputNum', maxlength: 15, required: false, target: 1 },
  { prop: 'storehouseNature', label: '库房性质', type: 'select', options: STOREHOUSE_NATURE_SELECT_LIST, required: false, target: 1 },
  { prop: 'storehouseAddress', label: '库房地址', type: 'input', required: false, target: 1 },
  { prop: 'plantNature', label: '厂房性质', type: 'select', options: PLANT_NATURE_SELECT_LIST, required: false, target: 1 },
  { prop: 'plantAddress', label: '厂房地址', type: 'input', required: false, target: 1 },
]
// 基本信息 生产信息
const PRODUCTION_INFO_FIELDS = [
  { prop: 'annualOutputValue', label: '年产值(万元)', type: 'input', maxlength: 30, required: false, target: 1 },
  { prop: 'dailyProduction', label: '日产量(万元)', type: 'input', maxlength: 30, required: false, target: 1 },
  { prop: 'equipmentCount', label: '设备数量(台)', type: 'input', maxlength: 30, required: false, target: 1 },
  { prop: 'equipmentRemark', label: '设备说明', ype: 'inputText', maxlength: 100, required: false, target: 1 },
  { prop: 'assemblyLineCount', label: '生产流水线数量(条)', type: 'input', maxlength: 30, required: false, target: 1 },
  { prop: 'inventory', label: '存货量(万元)', type: 'input', maxlength: 30, required: false, target: 1 },
]
// 人员信息 供应商人员信息
const PERSONNEL_INFO_FIELDS = [
  { prop: 'personName', label: '姓名', type: 'input', maxlength: 10, required: false, target: 1 },
  { prop: 'personPost', label: '职务', type: 'select', options: [], required: false, target: 1 }, // 职务下拉集合
  { prop: 'contactPhone', label: '联系电话', type: 'inputNum', maxlength: 11, required: false, target: 1 },
]
// 商品信息
const PRODUCT_INFO_FIELDS = [
  // 1 供应商信息
  { prop: 'supplierManageCategoryList', label: '经营品类', type: 'button', buttonList: [{ label: '修改', key: 'edit' }, { label: '查看', key: 'view' }], required: false, target: 1 }, // 经营品类 缺少options
  { prop: 'mainCategoryCode', label: '主营品类代码', type: 'input', required: false, target: 1, disabled: true },
  { prop: 'mainCategory', label: '主营品类', type: 'categorySelect', required: false, target: 1 },
  { prop: 'mainProduct', label: '主营商品', type: 'input', maxlength: 50, required: false, target: 1 },
  // 2 价格谈判
  { prop: 'marketValue', label: '面价', type: 'select', options: [], required: false, target: 2, dictId: 18 }, // 30:是，31：否
  { prop: 'marketValueRemark', label: '面价说明', type: 'inputText', maxlength: 200, required: false, target: 2 },
  { prop: 'priceControlCycle', label: '价格管理周期(天)', type: 'select', options: [], required: false, target: 2, dictId: 249 }, // 价格管理周期 947 月度 948 季度 949 半年 950 年度
  { prop: 'unifiedPrice', label: '是否全国统一价', type: 'select', options: [], required: false, target: 2, dictId: 10040, isMaster: true }, // 18913:是，18914：否
  { prop: 'priceRatio', label: '与我司同品类供应商价格差率', type: 'inputNum', required: false, target: 2 },
]

// 商品信息
const PRODUCT_INFO_VIEW_FIELDS = [
  // 1 供应商信息
  { prop: 'supplierManageCategoryList', label: '经营品类', type: 'button', buttonList: [{ label: '查看', key: 'view' }], required: false, target: 1 }, // 经营品类 缺少options
  { prop: 'mainCategoryCode', label: '主营品类代码', type: 'input', required: false, target: 1, disabled: true },
  { prop: 'mainCategory', label: '主营品类', type: 'input', required: false, target: 1, disabled: true }, // 主营品类 缺少options
  { prop: 'mainProduct', label: '主营商品', type: 'input', maxlength: 50, required: false, target: 1, disabled: true },
  // 2 价格谈判
  { prop: 'marketValue', label: '面价', type: 'select', options: [], required: false, target: 2, dictId: 18, disabled: true }, // 30:是，31：否
  { prop: 'marketValueRemark', label: '面价执行说明', type: 'inputText', maxlength: 200, required: false, target: 2, disabled: true },
  { prop: 'priceControlCycle', label: '价格管理周期', type: 'select', options: [], required: false, target: 2, dictId: 249, disabled: true }, // 价格管理周期 947 月度 948 季度 949 半年 950 年度
  { prop: 'unifiedPrice', label: '是否全国统一价', type: 'select', options: [], required: false, target: 2, dictId: 10040, isMaster: true, disabled: true }, // 18913:是，18914：否
  { prop: 'priceRatio', label: '与我司同品类供应商价格差率', type: 'inputNum', required: false, target: 2, disabled: true },
]

// 管理信息
const MANAGEMENT_INFO_FIELDS = [
  // 1 供应商信息
  { prop: 'supplierCode', label: '供应商代码', type: 'input', disabled: true, required: false, target: 1 },
  { prop: 'supplierName', label: '供应商名称', required: false, target: 1 },
  { prop: 'managementAreaId', label: '供应商管理区域', type: 'select', options: [], required: false, target: 1, dictId: 10000 },
  { prop: 'belongDepartment', label: '供应商归属中心', type: 'select', options: [], required: false, target: 1, dictId: 233 },
  { prop: 'supplierType', label: '供应商类型', type: 'select', required: false, target: 1, dictId: 10130, isMaster: true }, // 1001 供货供应商 1002 加工供应商 1003 租赁供应商 1004 服务类供应商 1005 内部加工供应商 1006 分公司 1007 物流供应商 1008 财务供应商 1009 供货商 1010 通用供应商
  { prop: 'supplierClassify', label: '供应商分类', type: 'select', options: SUPPLIER_CATEGORY_SELECT_LIST, disabled: true, required: false, target: 1 },
  // 2 价格谈判
  { prop: 'costCalculation', label: '成本核算', type: 'select', options: [], required: false, target: 2, dictId: 18 }, // 30：是，31：否
  { prop: 'costCalculationFormula', label: '成本核算公式表', type: 'annex', typeList: 'xlsx/xls/docx/doc/pdf/jpge/jpg/png' },
  { prop: 'bulkOrderDiscount', label: '批量订货优惠', type: 'select', options: [], required: false, target: 2, dictId: 18 }, // 30：是，31：否
  { prop: 'bulkOrderDiscountRemark', label: '批量优惠说明', type: 'inputText', maxlength: 200, required: false, target: 2 },
  // 6 合同谈判
  { prop: 'signContract', label: '是否签合同', type: 'select', options: YN_SELECT_LIST, required: false, disabled: true },
]

// 结算方式
const BILLING_METHOD_FIELDS = [
  { prop: 'commercialAcceptanceTypeArray', label: '商业承兑票据类型', type: 'select', required: false, multiple: true, collapseTags: false, options: COMMERCIAL_ACCEPTANCE_LIST, target: 3 },
  { prop: 'creditAcceptanceType', label: '信用票据承兑类型', required: false, target: 3 },
  { prop: 'acceptInvoice', label: '是否承兑', required: false, disabled: true, type: 'select', options: [], dictId: 18, target: 3 },
  { prop: 'acceptConversionFactor', label: '承兑折算系数', required: false, disabled: false, type: 'inputNum', target: 3 },
  { prop: 'acceptBankRequire', label: '承兑银行有无要求', type: 'select', options: [], required: false, target: 3, dictId: 264 },
  { prop: 'acceptBankRequireRemark', label: '承兑银行要求描述', required: false, type: 'annex', typeList: 'xlsx/xls/docx/doc/pdf/jpge/jpg/png', target: 3 },
]

// 合同信息 结算信息
const CONTRACT_BILLING_INFO_FIELDS = [
  { prop: 'reconciliationDate', label: '对账日', type: 'select', options: [], required: false, target: 3, dictId: 263, isSignContract: true },
  { prop: 'checkoutTime', label: '结账时间', type: 'select', options: [], required: false, target: 3, dictId: 15, isMaster: true, isSignContract: true },
  { prop: 'paidType', label: '付款方式', type: 'select', options: [], required: false, target: 3, dictId: 10131, isMaster: true, isSignContract: true }, // 40294 预付款 40295 带款提货 40296 货到付款 40297 票到付款 40298 背靠背付款
  { prop: 'checkoutRange', label: '结账区间', type: 'select', options: [], required: false, target: 3, dictId: 10133, isMaster: true, isSignContract: true },
  { prop: 'generalTaxpayer', label: '纳税人类型', type: 'select', options: [], required: false, target: 3, dictId: 310 }, // 30 是 31 否
  { prop: 'invoiceType', label: '发票类型', type: 'select', options: [], required: false, target: 3, dictId: 521, isMaster: true, isSignContract: true }, // 101 普通发票 102 增值税专用发票 103 无税票
  { prop: 'taxBillRate1', label: '税票率1', type: 'select', options: [], required: false, target: 3, dictId: 10100, isMaster: true, isSignContract: true },
  { prop: 'taxBillRate2', label: '税票率2', type: 'select', options: [], target: 3, dictId: 10100, isMaster: true, required: false, isSignContract: true },
  { prop: 'taxBillProvideTime', label: '税票提供时间', type: 'select', options: [], required: false, target: 3, dictId: 111 }, // isSignContract: true
  { prop: 'miniInvoiceMoney', label: '最低开票限额(元)', type: 'input', required: false, target: 3 },
  { prop: 'taxBillMoneyLimit', label: '税票提供限额（元）', type: 'input', required: false, target: 3 },
  { prop: 'taxBillTimeLimit', label: '税票提供时限（天）', type: 'input', required: false, target: 3 },
  { prop: 'rollingPrepayment', label: '是否滚动预付', type: 'select', options: [], required: false, target: 3, dictId: 18 },
  { prop: 'centralizedSettle', label: '是否集中结账', type: 'select', options: [], required: false, target: 3, dictId: 18 },
  { prop: 'centralizedSettlePlace', label: '集中结账地', type: 'select', options: [], required: false, target: 3, dictId: 224 },
  { prop: 'supplyChainFinance', label: '供应链金融', type: 'select', options: [], required: false, target: 3, dictId: 10040, isMaster: true }, // isSignContract: true
  { prop: 'expenseInvoice', label: '是否开费用发票', type: 'select', options: [], required: false, target: 3, dictId: 10040, isMaster: true }, // 18913：是，18914：否
]
// 合同信息 财务信息
const CONTRACT_FINANCIAL_INFO_FIELDS = [
  // 2 价格谈判
  { prop: 'priceBaseOnRawMaterial', label: '约定价格是否依据原材料进行公式核算', type: 'select', options: PRICE_BASE_ON_RAW_MATERIAL_SELECT_LIST, required: false, target: 2, isSignContract: true }, // 缺少options
  { prop: 'rawMaterialPriceRef', label: '原材料价格参照方', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'rawMaterialPriceFloatRate', label: '原材料价格浮动率(%)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'goodsName', label: '产品名称', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'goodsPriceFloatRate', label: '产品价格浮动率(%)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'coreRawMaterialName', label: '原材料名称', type: 'input', required: false, target: 2 },
  { prop: 'stockInsurance', label: '是否库存保价', type: 'select', options: [], required: false, target: 2, dictId: 18 }, // isSignContract: true
  { prop: 'stockInsuranceRemark', label: '库存保价说明', type: 'input', required: false, target: 2 }, // isSignContract: true
  { prop: 'priceIncreaseNotice', label: '涨价提前通知时间(天)', type: 'select', options: [], required: false, target: 2, isSignContract: true, dictId: 230 },
]

// 合同信息 铺底质保信息
const CONTRACT_QUALITY_INFO_FIELDS = [
  // 3 账期谈判
  { prop: 'initialCapital', label: '铺底金', type: 'inputNum', min: 0, required: false, target: 3, isSignContract: true, default: 0 },
  { prop: 'initialCapitalCollectType', label: '铺底金收取方式', type: 'select', options: [], required: false, target: 3, dictId: 261, isSignContract: true }, // 1046 电汇 1047 首次货款中扣除
  { prop: 'retentionMoney', label: '质量保证金', type: 'inputNum', min: 0, required: false, target: 3, isSignContract: true, default: 0 },
  { prop: 'retentionMoneyCollectType', label: '质量保证金收取方式', type: 'select', options: [], required: false, target: 3, dictId: 260, isSignContract: true }, // 1044 电汇 1045 首次货款中扣除
  { prop: 'etcQaExecuteArea', label: '铺底质保金执行区域', type: 'select', options: [], multiple: true, required: false, target: 3, dictId: 10001 }, // 缺少options 下拉多选
]
// 合同信息 返利信息
const CONTRACT_REBATE_INFO_FIELDS = [
  { prop: 'rebate', label: '是否返利', type: 'select', options: [], required: false, target: 2, dictId: 18, isSignContract: true }, // 30 是 31 否
  { prop: 'monthlyRebateStandard', label: '月度返利标准', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'monthlyRebateMoneyStep', label: '月度返利阶梯金额(万元)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'monthlyRebateRatio', label: '月度返利比例/金额', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'quarterlyRebateStandard', label: '季度返利标准', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'quarterlyRebateMoneyStep', label: '季度返利阶梯金额(万元)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'quarterlyRebateRatio', label: '季度返利比例/金额', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'halfYearRebateStandard', label: '半年度返利标准', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'halfYearRebateMoneyStep', label: '半年度返利阶梯金额(万元)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'halfYearRebateRatio', label: '半年度返利比例/金额', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'yearRebateStandard', label: '年度返利标准', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'yearRebateMoneyStep', label: '年度返利阶梯金额(万元)', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'yearRebateRatio', label: '年度返利比例/金额', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'overallRebateRatio', label: '预计整体返利比例/金额', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'otherRebate', label: '其他返利条款', type: 'input', required: false, target: 2, isSignContract: true },
  { prop: 'rebateCalculateType', label: '返利计算方式', type: 'select', options: [], required: false, target: 2, dictId: 250 }, // 1014 回款额 1015 进货额 isSignContract: true
  { prop: 'rebateCalculateLogic', label: '返利计算逻辑', type: 'select', options: [], required: false, target: 2, dictId: 251 }, // 1016 累计 1017 阶梯 isSignContract: true
  { prop: 'rebateCashType', label: '返利兑现方式', type: 'select', options: [], required: false, target: 2, dictId: 241, isSignContract: true }, // 892 返现 893 返货 894 账款扣除
  { prop: 'rebateInvoice', label: '返利是否开票', type: 'select', options: [], required: false, target: 2, dictId: 18 }, // 30 是 31 否
  { prop: 'rebateExecuteTime', label: '返利执行时间', type: 'dateTiem', required: false, target: 2 }, // isSignContract: true
  { prop: 'rebateCashDays', label: '年度返利兑现天数', type: 'inputNum', required: false, target: 2, isSignContract: true },
  { prop: 'rebateCashDaysSeason', label: '月/季度返利兑现天数', type: 'inputNum', required: false, target: 2, isSignContract: true },
  { prop: 'includedRebateNextYear', label: '是否计入来年返利', type: 'select', options: [], required: false, target: 2, dictId: 10040, isMaster: true }, // 18913 是 18914 否 isSignContract: true
]
// 合同信息 交付信息
const CONTRACT_DELIVERY_INFO_FIELDS = [
  // 2 价格谈判
  { prop: 'freightPayer', label: '运费承担方', type: 'select', options: [], required: false, target: 2, dictId: 10146, isMaster: true, isSignContract: true }, // 40357 我司承担 40358 供应商承担 40359 无运费
  // 4 产品交付谈判
  { prop: 'arrivalPeriod', label: '到货周期', type: 'input', required: false, target: 4, isSignContract: true },
  { prop: 'minPurchaseQuantity', label: '单次最小要货量(万元)', type: 'inputNum', required: false, target: 4 },
  { prop: 'deliveryPlace', label: '来货方式', type: 'select', options: [], required: false, target: 4, dictId: 10152, isMaster: true }, // 40412 物流快递到我司库房 40413 物流快递到货运站 40418 供应商自有车辆到我司库房 40422 厂家自提
  // 667 带托盘 668 带吊装带 669 带吨袋 1054 带货框 1055 带吨袋+托盘 1056 带吨袋+货框 1057 带吨袋+吊装带 1058 带托盘+货框 1060 带托盘+吊装带
  // 1061 带木轴+防雨布 1062 带吨袋+货框+吊装带 1063 带托盘+货框+吨袋 1064 带托盘+货框+吊装带 1065 带货框+吊装带 1097 无
  { prop: 'dischargeCargo', label: '卸货方', type: 'select', options: [], required: false, target: 4, dictId: 252, isSignContract: true }, // 1018 由乙方负责卸车落地、码垛 1019 由甲方负责卸车落地、码垛
  { prop: 'minReturnAmount', label: '最小退货金额(元)', type: 'inputNum', required: false, target: 4 },
  // 5 质量问题谈判
  { prop: 'acceptanceProportion', label: '验收比例', type: 'input', required: false, target: 5 },
  { prop: 'warrantyMonths', label: '质量保证期(月)', type: 'input', required: false, target: 5, isSignContract: true },
  { prop: 'packingRequire', label: '包装要求', type: 'select', options: [], required: false, target: 5, dictId: 254 }, // 多选
]

export {
  BASE_INFO_FIELDS,
  BASIC_INFO_FIELDS,
  BASIC_INFO_VIEW_FIELDS,
  PRODUCTION_INFO_FIELDS,
  PERSONNEL_INFO_FIELDS,
  PRODUCT_INFO_FIELDS,
  PRODUCT_INFO_VIEW_FIELDS,
  MANAGEMENT_INFO_FIELDS,
  CONTRACT_BILLING_INFO_FIELDS,
  BILLING_METHOD_FIELDS,
  CONTRACT_FINANCIAL_INFO_FIELDS,
  CONTRACT_QUALITY_INFO_FIELDS,
  CONTRACT_REBATE_INFO_FIELDS,
  CONTRACT_DELIVERY_INFO_FIELDS
}
